<template>
  <div class="home">
    <HelloWorld :msg="$store.state.a" />
    <p>{{$store.di}}</p>
    <button @click="add">获取</button>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";

export default {
  name: "Home",
  components: {
    HelloWorld,
  },
  methods: {
    add(){
      // console.log(this.$store.dispatch);
      console.log(this.$store.state.a.count);
      this.$store.dispatch('action');
    }
  }
};
</script>
